package com.atguigu.common.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * @create: 2024/9/12
 * @author: gyhe10
 * @description: 库存不足的自定义异常
 **/

public class NoStockException extends RuntimeException {
    @Getter
    @Setter
    private Long skuId;

    public NoStockException(Long skuId) {
        super("商品id:" + skuId + "没有足够的库存了");
    }

    public NoStockException(String msg) {
        super(msg);
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }
}
